﻿using KalevaAalto.DataPart.Enums;
using KalevaAalto.DataPart.Models;
using OfficeOpenXml.Style;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace KalevaAalto.DataPart.Excel.Epplus
{
    internal class EpplusFont : IFont
    {
        private ExcelFont _font;
        public EpplusFont(ExcelFont font)
        {
            _font = font;
        }

        public FontWeight Weight 
        { 
            get => _font.Bold? FontWeight.Thin:FontWeight.Bold;
            set
            {
                switch (value)
                {
                    case FontWeight.Bold:_font.Bold = true;return;
                    case FontWeight.Bolder: _font.Bold = true; return;
                    case FontWeight.Thin: _font.Bold = false; return;
                    default:throw new NotFiniteNumberException();
                }
            }
        }
        public float Size { get => _font.Size; set => _font.Size =value; }
        public string Name { get => _font.Name; set => _font.Name=value; }
        public Color Color { get =>  throw new NotImplementedException(); set => _font.Color.SetColor(value); }
        public UnderLineStyle UnderLine { get => _font.UnderLine?UnderLineStyle.Thin:UnderLineStyle.None; set => _font.UnderLine= !(value==UnderLineStyle.None); }
    }
}
